#include <stdio.h>
#include <string.h>
#include "appload.h"
#include "sysdef.h"
#include "device.h"
#include "gpio.h"
#include "os.h"

void led_test(void *argv)
{
    UNUSED(argv);
    gpio_t *gpio = gpio_find_by_pin(GPIO_PIN_21);
    gpio_cfg_t cfg = {GPIO_MODE_OUT_PP};
    gpio->open(&cfg);
    while(1)
    {
        gpio->write(1);
        OSTimeDlyHMSM(0, 0, 1, 0, OS_OPT_TIME_DLY, NULL);
        gpio->write(0);
        OSTimeDlyHMSM(0, 0, 1, 0, OS_OPT_TIME_DLY, NULL);
    }
}

dev_export(DEV_CLASS_GPIO, "led_pin", GPIO_PIN_21);
app_export(led_test, NULL, "led_test", 4096, 30, 1);
